<template name="adminImportNew">
	<section class="page-container page-home page-static page-settings">
		{{> header sectionName=pageTitle}}
		<div class="content">
			<a href="{{pathFor "admin-import"}}"><i class="icon-angle-left"></i> {{_ "Back_to_imports"}}</a><br><br>

			{{#unless hasPermission 'run-import'}}
				<p>{{_ "You_are_not_authorized_to_view_this_page"}}</p>
			{{else}}
				{{#if isPreparing}}
					{{> loading}}
				{{else}}

					<div class="rocket-form">
						<div class="section">
							<div class="section-content">
								<div class="input-line double-col">
									<label>{{_ "Import_Type"}}</label>
									<select name="import-type" class="import-type required rc-input__element">
										<option value="" selected="{{$eq importType ''}}">{{_ "Select_an_option"}}</option>

										{{#each importers}}
											<option value="{{_ key}}" selected="{{$eq importType key}}">{{_ name}}</option>
										{{/each}}
									</select>
								</div>

								{{#if isImporterSelected}}
									<div class="input-line double-col">
										<label>{{_ "File_Type"}}</label>
										<select name="file-type" class="file-type required rc-input__element">
											<option value="upload" selected="{{$eq fileType 'upload'}}">{{_ "Upload"}}</option>
											<option value="url" selected="{{$eq fileType 'url'}}">{{_ "Public_URL"}}</option>
											<option value="path" selected="{{$eq fileType 'path'}}">{{_ "Server_File_Path"}}</option>
										</select>
									</div>

									{{#if isUpload}}
										<div class="input-line double-col">
											<label></label>
											<div class="section-content">
												{{ fileSizeLimitMessage }}
											</div>
										</div>

										<div class="input-line double-col">
											<label>{{_ "Importer_Source_File"}}</label>
											<input type="file" class="import-file-input rc-input__element">
										</div>
									{{else}}
										{{#if isFileTypeSelected}}
											<div class="input-line double-col">
												{{#if isPublicURL}}
													<label>{{_ "File_URL"}}</label>
												{{else}}
													{{#if isServerFile}}
														<label>{{_ "File_Path"}}</label>
													{{/if}}
												{{/if}}

												<input type="text" class="import-file-url rc-input__element">
											</div>

											<div class="input-line double-col">
												<label></label>
												<input type="button" class="rc-button rc-button--primary action import-btn" value="{{_ "Import" }}">
											</div>
										{{/if}}
									{{/if}}
								{{/if}}

							</div>
								
						</div>
					</div>

					
				{{/if}}
				
			{{/unless}}
		</div>
	</section>
</template>
